package com.j1ay.forum.controller;

import com.j1ay.forum.model.pojo.vo.Result;
import com.j1ay.forum.service.DataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author J1ay
 * @Date 2021/12/26 15:17
 * @Description 数据统计
 */

@RestController
@RequestMapping("api/data")
@Api(value="Data Controller",tags={"数据统计接口"})
public class DataController {

    @Autowired
    private DataService dataService;


    @ApiOperation("获取当前问题数相关的数据")
    @GetMapping("ask")
    public Result getAskCount() {
        return dataService.getAskCount();
    }

    @ApiOperation("获取当前回答数相关的数据")
    @GetMapping("answer")
    public Result getAnswerCount() {
        return dataService.getAnswerCount();
    }
}
